KM-Logic: Computationally Efficient Real-Time MIMO Fuzzy Inference System

ABSTRACT

A system and method of determining an output of an n-input fuzzy logic system are provided. A plurality of membership functions associated with a corresponding plurality of inputs is determined along with a list of fuzzy rules for the n-input fuzzy logic system. An input of the plurality of inputs is selected. Two active rules and their corresponding output values are selected from the list of rules. Membership values of two active membership functions are determined. An output of the n-input fuzzy system is calculated by multiplying the two membership values with the output of the two active rules and is saved. Recursively repeating, for each additional input, the determining and calculating steps and multiplying the output with the saved output, then saving the new output.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims the benefit of and priority to U.S. ProvisionalApplication Ser. No. 62/313,183, entitled “KM-Logic: ComputationallyEfficient, Real-Time MIMO Fuzzy Inference System,” filed on Mar. 25,2016, and U.S. Provisional Application Ser. No. 62/362,267, entitled“KM-Logic: Computationally Efficient, Real-Time MIMO Fuzzy InferenceSystem,” filed on Jul. 14, 2016, 2016, the entireties of which areincorporated by reference herein.

RIGHTS TO THE GOVERNMENT

The invention described herein may be manufactured and used by or forthe Government of the United States for all governmental purposeswithout the payment of any royalty.

BACKGROUND OF THE INVENTION

Field of the Invention. The present invention generally relates to fuzzylogic system.

Description of the Related Art.

In real world applications such as industrial processes and processcontrol, precise knowledge of the system being controlled is notcompletely known and the system behavior is generally nonlinear.Therefore, it is difficult to precisely control these systems withconventional techniques. However, fuzzy logic controllers (FLCs) havedemonstrated excellent performance for these types of systems. Unliketraditional two valued logic having logic states of 0 or 1, fuzzy settheory allows a degree of truth for a variable to exist somewhere in therange [0,1]. For example, if pressure is a linguistic variable thatdescribes an input, then the terms low, medium, high and dangerousdescribe the fuzzy set for the pressure variable. For controlapplications, linguistic variables describe the control inputs fordynamic plants and rules define the relationships between the inputs.Thus, precise knowledge of a plant's transfer function is not necessaryfor design and implementation of the controller. Contemporary FLCs havealso shown improved performance over classical controllers when theplant transfer function is known. The thrust of early efforts in fuzzycontrol involved replacing humans in the control loop by describing theoperators' actions in terms of linguistic rules.

One of the drawbacks of fuzzy logic controllers, however, is thecomputation time required to combine all the membership values of everyinput to form a firing value for each rule. For a given number ofmembership functions in each input fuzzy set, the number of fuzzy rulesincreases geometrically with the number of inputs. For example, for atwo input fuzzy system with 7 membership functions each, there are 7²=49fuzzy rules. However, for a four input fuzzy system with 7 membershipfunctions each, there are 7⁴=2401 fuzzy rules. This geometricallyprogression of the number of rules becomes an obstacle for practicalapplication of multi-input fuzzy system because of the time it takes toimplement these systems. For example, using a python implementation on a2.7 GHz CPU and 16 GB RAM, it takes 0.265 milliseconds to produce anoutput for a 2-input systems. However, this time increases to 11.5milliseconds for a 4-input system. Therefore, practical applications aregenerally restricted to two or at most three inputs in contemporaryfuzzy systems.

Accordingly, there is a need in the art for a more computationallyefficient multi-input fuzzy logic system.

SUMMARY OF THE INVENTION

Fuzzy logic controllers have demonstrated excellent performance in realworld applications where a precise knowledge of the system beingcontrolled is not completely known and their behavior is generallynonlinear. One of the drawbacks of fuzzy logic controllers, however, isthe computation time it takes to combine all the membership values ofevery input to form firing value for each rule. For a given number ofmembership functions in each input fuzzy set, the number of fuzzy rulesincrease geometrically with the number of inputs. This geometricprogression of the number of rules becomes an obstacle for practicalapplication of multi-input fuzzy system because of the time it takes toimplement these systems. To overcome this geometric progression,embodiments of the invention provide a novel recursive algorithm toimplement multi-input fuzzy systems. In this method each input is fuzzypartitioned into membership functions for which only two membershipfunctions are active and a sum of their membership values is equal toone for any crisp input. This reduces the firing rules resulting insignificantly reduced implementation time.

A system and method of determining an output of an n-input fuzzy logicsystem are provided. A plurality of membership functions associated witha corresponding plurality of inputs to the n-input fuzzy logic systemare defined along with a list of fuzzy rules. For a first input of thefuzzy system, two active rules and their corresponding output values areselected from the list of rules. The membership values of the two activemembership functions are determined and the output of the fuzzy systemis calculated by multiplying the two membership values with the outputof the two active rules. This output is then saved. If the fuzzy systemhas additional inputs, the steps of selecting an input, determining theoutputs of the two active rules, and calculating the output bymultiplying the outputs of the two active rules with the two membershipvalues are recursively repeated for each input. At the end of each setof steps, the newly calculated output is multiplied by the saved outputof the previous steps. This new output is then saved and processcontinues until all inputs have been processed. If there are noadditional inputs, the saved output may be output to the control systemfor action by a control system on a process being controlled.

Additional objects, advantages, and novel features of the invention willbe set forth in part in the description which follows, and in part willbecome apparent to those skilled in the art upon examination of thefollowing or may be learned by practice of the invention. The objectsand advantages of the invention may be realized and attained by means ofthe instrumentalities and combinations particularly pointed out in theappended claims.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings, which are incorporated in and constitute apart of this specification, illustrate embodiments of the invention and,together with a general description of the invention given above, andthe detailed description given below, serve to explain the invention.

FIG. 1 is a schematic diagram showing components of an exemplary fuzzylogic controller;

FIG. 2 is a graph showing three triangular input membership functions;

FIG. 3 is a graph showing three triangular output membership functions;

FIG. 4 is a flow diagram illustrating a recursive algorithm used withembodiments of the invention;

FIG. 5 is the recursive algorithm of FIG. 4 implemented in MATLAB® andused with embodiments of the invention.

FIG. 6 is a graph illustrating computation times of FLC systems with2-10 inputs;

FIG. 7 is a graph illustrating computation times of FLC systems withdifferent numbers of membership functions; and

FIG. 8 is a diagrammatic illustration of an exemplary hardware andsoftware environment able to implement a fuzzy logic system consistentwith embodiments of the invention.

It should be understood that the appended drawings are not necessarilyto scale, presenting a somewhat simplified representation of variousfeatures illustrative of the basic principles of the invention. Thespecific design features of the sequence of operations as disclosedherein, including, for example, specific dimensions, orientations,locations, and shapes of various illustrated components, will bedetermined in part by the particular intended application and useenvironment. Certain features of the illustrated embodiments have beenenlarged or distorted relative to others to facilitate visualization andclear understanding. In particular, thin features may be thickened, forexample, for clarity or illustration.

DETAILED DESCRIPTION OF THE INVENTION

Genetic fuzzy tree (GFT) methodology allows fuzzy control to be appliedto big-data type problems. This technology utilizes a collection offuzzy inference systems (FIS) with varied levels of connectivity andhence, generally requires more than 3 inputs. In order to significantlyreduce the computation time, embodiments of the invention utilize a setof partitioned input membership functions for which a sum of membershipvalues is equal to one for any crisp input. If a partitioned input iscomposed of triangular membership functions each with a maximum value ofone, then a maximum of two membership functions will have non-zeromembership value. This partitioning of input fuzzy sets will be referredto herein as fuzzy partitioning when describing embodiments of theinvention below. Other embodiments may utilize trapezoidal membershipfunctions, where the trapezoidal function is accommodated by having twotriangular membership functions: one with a slope of 0 and an offset of1, and the other with a slope of 0 and an offset of 0. Thus, only twomembership values from each input need to be combined to determine thefiring values for each rule. Therefore, for a four input fuzzy systemwith 7 membership functions each, only 2⁴=8 fuzzy rules are active inproducing the crisp output of the fuzzy system instead of the 2401 fuzzyrules in contemporary systems. This significantly reduces thecomputational time to evaluate FIS. For example, using C implementationof embodiments of the invention on a 2.7 GHz CPU with 16 GB RAM requires1.75 microseconds to produce an output for a 2-input systems and thistimes increases almost linearly to only 7.3 microseconds for a 4-inputsystem. Further, embodiments of the invention additionally utilize arecursive algorithm based on fuzzy partitioning to implement multi-inputfuzzy systems in which the implementation time is linearly proportion tothe number of inputs. The simulation results discussed in relation toembodiments of the invention are carried out with different number ofinputs and different number of membership functions in each input.

Turning now to the figures, FIG. 1 illustrates the building blocks of aFuzzy Logic Controller (FLC) 10. The basic design parameters of the FLC10 include input 12 and output 14 scaling factors, fuzzification 16,inference engine 18, knowledge base 20, and defuzzification 22.

The scaling factor at the input 12 is used to map the physical values ofthe process into a normalized universe of discourse (normalized domain).The output scaling 14 (de-normalization) is used to map the normalizedoutput of the controller back onto the physical domain of the system.

The knowledge base 20 contains knowledge of input and output fuzzy sets,and if-then fuzzy rules. Each input and output variable is partitionedinto a finite number of overlapping membership functions on its universeof discourse and the if-then fuzzy rules relate the input membershipfunctions to the output membership functions (assuming only 1-input).FIG. 2 illustrates three triangular membership functions N, Z, P, whichcharacterize a fuzzy partitioning of input variable×defined in anormalized domain [−1, 1]. The middle function, zero (Z) is centered atzero with the remaining membership functions, negative (N) and positive(P) dividing the universe of discourse from −1 to 1 symmetrically withcenter point at −1 and 1, respectively. In some embodiments, the widthof the input membership functions extends to the center point (peakvalue) of adjacent membership functions as illustrated in FIG. 2.Therefore, only two adjacent membership functions are active for anycrisp input and the sum of the their membership values is equal to one,i.e., μ_(x)(j)+μ_(x)(j+1)=1.

Linguistic rules express the relationship between the inputs and outputmembership functions and can be written in terms of if-then rules, suchas:

R_(n): if inputn is X_(n)(n) and . . . and input2 is X₂(k) and input1 isX₁(j) then output is U(n . . . kj)

where:

1≦j≦ (number of membership functions within input1 fuzzy set (X₁(j)),

1≦k≦ (number of membership functions within input2 fuzzy set (X₂(k)), .. .

1≦n≦ (number of membership functions within inputn fuzzy set (X_(n)(n)),and

U(n . . . kj) is one of the membership functions in output fuzzy setshown in FIG. 3.

Note that the rules are listed in the order of all combinations of firstmembership function of inputn, . . . , first membership function ofinput2, and all membership functions of input1 (3 rules in this case)followed by the all combinations of first membership function of inputn,. . . , second membership function of input2, (3 rules) and so on. Ifthree membership functions in the output fuzzy set are assumed, the rulelist for an n-input fuzzy system may be written as

$\begin{matrix}{{\begin{bmatrix}{{Rule}\mspace{14mu} {Location}} \\1 \\2 \\3 \\4 \\\vdots \\3^{n}\end{bmatrix}\begin{bmatrix}x_{n} & \ldots & x_{2} & x_{1} \\{X_{n}(1)} & \ldots & {X_{2}(1)} & {X_{1}(1)} \\{X_{n}(1)} & \ldots & {X_{2}(1)} & {X_{1}(1)} \\{X_{n}(1)} & \ldots & {X_{2}(1)} & {X_{1}(1)} \\{X_{n}(1)} & \ldots & {X_{2}(1)} & {X_{1}(1)} \\\vdots & \ldots & \vdots & \vdots \\{X_{n}(3)} & \ldots & {X_{2}(1)} & {X_{1}(1)}\end{bmatrix}}\begin{bmatrix}u \\{U\left( {1\mspace{14mu} \ldots \mspace{14mu} 11} \right)} \\{U\left( {1\mspace{14mu} \ldots \mspace{14mu} 12} \right)} \\{U\left( {1\mspace{14mu} \ldots \mspace{14mu} 13} \right)} \\{U\left( {1\mspace{14mu} \ldots \mspace{14mu} 21} \right)} \\\vdots \\{U\left( {1\mspace{14mu} \ldots \mspace{14mu} 33} \right)}\end{bmatrix}} & (1)\end{matrix}$

For a given crisp input, fuzzification finds the degree of membership ineach membership function. In FIG. 2, if the input x has a value betweenthe center points of membership function Z(X(2)) and P(X(3)), fuzzy setsX(2) and X(3) are active and the input has membership values of μ_(x)(2)and μ_(x)(3) in fuzzy set X(2) and X(3), respectively. The input has amembership value μ_(x)(1)=0 in membership function X(1). Now, if x(j) isthe center point of the membership function X(j), then the membershipvalues in fuzzy sets X(j) and X(j+1) can be calculated using equations(2) and (3), respectively as

$\begin{matrix}{{\mu_{x}(j)} = \frac{{x\left( {j + 1} \right)} - x}{{x\left( {j + 1} \right)} - {x(j)}}} & (2) \\{{\mu_{x}\left( {j + 1} \right)} = \frac{x - {x(j)}}{{x\left( {j + 1} \right)} - {x(j)}}} & (3)\end{matrix}$

Note that the sum of the membership values over the interval between twoadjacent sets is one, i.e., μ_(x)(j)+μ_(x)(j+1)=1. Therefore, the sum ofall membership over the universe of discourse at any instant for acontrol variable will always be equal to one.

Fuzzy inference (rule evaluation) module 18 determines the implicationof each active rule (rule strength) by multiplying (PRODUCT for ANDfuzzy implication) the degree of membership obtained during thefuzzification module. For a 2-input exemplary system, the strength of arule n is given by

μ_(n)=μ_(x2)(index₂)×μ_(x1)(index₁)   (4)

The consequent of each rule is then determined by weighing the outputmembership function by its strength. The output of the fuzzy inferencemodule is the fuzzy set determined by combining maximum value (maximumfor OR) of all the weighted consequences.

In many instances, such as control systems, it may be necessary toconvert the fuzzy set obtained from the fuzzy inference module to acrisp value and then send this value to a process being controlled. Thisfunction is carried out by the defuzzification module 22. A contemporaryfrequently used method is the Centroid (center of gravity) or center ofarea method. This method computes an area underneath an output fuzzy setproduced by the inference module 18. The value at the center of thecombined area is taken as the output crisp value. However, this methodmay also be computationally expensive for real-time systems. Therefore,a technique referred to as a simplified reasoning method (also known asthe modified centroid of area method) may be used with some embodimentsof the invention, though other embodiments may use other methods. Thismethod uses a weighted average of rule strength of each fuzzy ruleobtained from fuzzy inference module 18 and the center points of theoutput membership function for that rule. The weighted average of theoutput center values and the rule strengths gives the output expressionof the fuzzy system as

$\begin{matrix}{{{out}(n)} = \frac{\sum\limits_{i = 1}^{2^{n}}{\mu_{i}u_{i}}}{\sum\limits_{i = 1}^{2^{n}}\mu_{i}}} & (5)\end{matrix}$

where n is the number of inputs, μ_(i) is the center value of themembership function in the output fuzzy set for the i^(th) rule andμ_(i) is the product rule applied to the antecedent of the i^(th) fuzzyrule for the n—input system given by

$\mu_{i} = {\prod\limits_{m = 1}^{n}\; {{\mu_{xm}\left( {{index}_{m}\mspace{14mu} {of}\mspace{14mu} {the}\mspace{14mu} i^{th}\mspace{14mu} {rule}} \right)}.}}$

Note that if fuzzy partitioning is assumed, the sum of the product ofthe membership values for the 2^(n) active rule (denominator in equation(5)) is equal to one. Therefore, the output of the fuzzy system withn—inputs is given by

$\begin{matrix}{{{out}(n)} = {\sum\limits_{i = 1}^{2^{n}}{\mu_{i}u_{i}}}} & (6)\end{matrix}$

The weighted average method is computationally less expensive comparedto the center of gravity method. However, in equation (6), themembership value μ_(i) is computed using the membership values of everymembership function in each input to form the firing value for eachrule. As the number of membership functions and the number of inputsincrease, the time taken to find μ_(i) becomes an obstacle for practicalapplication of multi-input fuzzy system. One way to significantly reducethe computation time is to use partitioned triangular membershipfunctions for which a maximum of two membership functions have non-zeromembership value. Thus, only two membership values from each input needto be combined to determine the firing values for each rule. Therefore,for a four input fuzzy system with seven membership functions each, only2⁴=8 fuzzy rules are active in producing the crisp output of the fuzzysystem instead of 7⁴=2401 rules. This significantly reduces thecomputational time to evaluate fuzzy system as set out in more detailbelow.

If X₁(j) are the membership functions in the input1 (x₁) fuzzy set shownin FIG. 2 and U(o) are the membership functions in the output (u) fuzzyset shown in FIG. 3, the linguistic rules describing a 1-input, 1-output(n=1) fuzzy system in natural language are of the form:

if input1 x₁ is X₁(j) then output u is U(o)

where:

1≦j≦ (number of membership functions within the input1 fuzzy set (X₁(j))and

1≦o≦ (number of membership functions within the output fuzzy set U(o).

If both the input and output variables have three membership functions,the list of 3 rules (R1 . . . R3) in natural language may be written as:

R₁: if input x₁ is X₁(1) then output u is U(1)

R₂: if input x₁ is X₁(2) then output u is U(2)

R₃: if input x₁ is X₁(3) then output u is U(3)   (7)

Note that the number of fuzzy rules depends only on the number ofmembership functions in the input and does not depend on the number ofoutput membership functions. Therefore, the number of output fuzzy setsdoes not have to be equal to the number of input fuzzy sets. For a1-input fuzzy system (for example, proportional fuzzy controller) with 3fuzzy sets (N, Z and P) for input and output shown in FIGS. 2 and 3, therule-base can be written as

$\begin{matrix}\left. {{\begin{bmatrix}{{Rule}\mspace{14mu} {Location}} \\1 \\2 \\3\end{bmatrix}\begin{bmatrix}x_{1} \\{X_{1}(1)} \\{X_{1}(2)} \\{X_{1}(3)}\end{bmatrix}}\begin{bmatrix}u \\{U(\; 1)} \\{U(\; 2)} \\{U(3)}\end{bmatrix}}\Rightarrow{\begin{bmatrix}x_{1} \\N \\Z \\P\end{bmatrix}\begin{bmatrix}u \\N \\Z \\P\end{bmatrix}} \right. & (8)\end{matrix}$

Now, if the normalized value of the input x₁ lies within the centerpoints of membership functions X(2) and X(3), then the two active rulesfrom the list of rules given in equation (8) are given by

$\begin{matrix}{{\begin{bmatrix}{index}_{1} \\2 \\3\end{bmatrix}\begin{bmatrix}x_{1} \\{X_{1}(2)} \\{X_{1}(3)}\end{bmatrix}}\begin{bmatrix}u \\{U(2)} \\{U(3)}\end{bmatrix}} & (9)\end{matrix}$

The index of the first active rule is index₁ ¹=2 and the index of thesecond rule is index₁ ²=3. For this example, if u(2) and u(3) are thecenter points of output fuzzy sets U(2) and U(3), respectively inequation (8), the output of the rule-list is represented as 2×1 matrixin equation (10) as

$\begin{matrix}{A_{1} = {\begin{bmatrix}{u(2)} \\{u(3)}\end{bmatrix} = \begin{bmatrix}{a(1)} \\{a(2)}\end{bmatrix}}} & (10)\end{matrix}$

Using equation (6), the output of the 1-input, 1-output fuzzy system isgiven by

$\begin{matrix}\begin{matrix}{{{out}(1)} = {{{\mu_{x\; 1}\left( {index}_{1}^{1} \right)} \times {a(1)}} + {{\mu_{x\; 1}\left( {index}_{1}^{2} \right)} \times {a(2)}}}} \\{= {\begin{bmatrix}{{\mu_{x\; 1}\left( {index}_{1}^{1} \right)}\mspace{11mu}} & {{\mu_{x\; 1}\left( {index}_{1}^{2} \right)}\mspace{11mu}}\end{bmatrix} \times A_{1}}} \\{= {f(1)}}\end{matrix} & (11) \\{where} & \; \\{{f(i)} = {{{\mu_{x\; 1}\left( {index}_{1}^{1} \right)} \times {a(i)}} + {{\mu_{x\; 1}\left( {index}_{1}^{2} \right)} \times {a\left( {i + 1} \right)}}}} & (12)\end{matrix}$

is the output of the two adjacent active rules for input1 (2^(nd) and3^(rd) rules for this example).

For a 2-inputs 1-output fuzzy system (n=2), the linguistic rules can bedescribed in natural language as

if input2(x₂) is X₂(k) and input1(x₁) is X₁(j) then output is U(kj)

where 1≦j≦ (number of membership functions within input1 fuzzy set(X₁(j))), 1≦k≦ (number of membership functions within input2 fuzzy set(X₂(k))), and U(kj) is one of the membership function in output fuzzyset shown in FIG. 3. If each input variable has three membershipfunctions, there are 9 rules (R₁ . . . R₉). Note that the rules arelisted in the order of all combinations of first membership function ofinput2 and all membership functions of input1 (3 rules in this case)followed by the second membership functions of input2 and all membershipfunctions of input1 (3 rules in this case) and so on. If threemembership functions in the output fuzzy set are assumed, the rule listfor a 2-input proportional plus derivative (PD) controller may bewritten as

$\begin{matrix}\left. {{\begin{bmatrix}{{Rule}\mspace{14mu} {Location}} \\1 \\2 \\3 \\4 \\5 \\6 \\7 \\8 \\9\end{bmatrix}\begin{bmatrix}x_{2} & x_{1} \\{X_{2}(1)} & {X_{1}(1)} \\{X_{2}(1)} & {X_{1}(2)} \\{X_{2}(1)} & {X_{1}(3)} \\{X_{2}(2)} & {X_{1}(1)} \\{X_{2}(2)} & {X_{1}(2)} \\{X_{2}(2)} & {X_{1}(3)} \\{X_{2}(3)} & {X_{1}(1)} \\{X_{2}(3)} & {X_{1}(2)} \\{X_{2}(3)} & {X_{1}(3)}\end{bmatrix}}\begin{bmatrix}u \\{U(11)} \\{U(12)} \\{U(13)} \\{U(21)} \\{U(22)} \\{U(23)} \\{U(31)} \\{U(32)} \\{U(33)}\end{bmatrix}}\Rightarrow{\begin{bmatrix}x_{2} & x_{1} \\N & N \\N & Z \\N & P \\Z & N \\Z & Z \\Z & P \\P & N \\P & Z \\P & P\end{bmatrix}\begin{bmatrix}u \\N \\N \\Z \\N \\Z \\P \\Z \\P \\P\end{bmatrix}} \right. & (13)\end{matrix}$

Now, if the normalized value of input1 lies within the center points ofmembership functions Z(X₁(2)) and P(X₁(3)) and the normalized value ofinput2 lies within the center points of membership functions N(X₂(1))and Z(X₂(2)), then the four active rules from the rule list given in(14) are given by

$\begin{matrix}{{{\begin{bmatrix}{{Rule}\mspace{14mu} {Location}} \\2 \\3 \\5 \\6\end{bmatrix}\begin{bmatrix}{index}_{2} & {index}_{1} \\1 & 2 \\1 & 3 \\2 & 2 \\2 & 3\end{bmatrix}}\begin{bmatrix}x_{2} & x_{1} \\{X_{2}(1)} & {X_{1}(2)} \\{X_{2}(1)} & {X_{1}(3)} \\{X_{2}(2)} & {X_{1}(2)} \\{X_{2}(2)} & {X_{1}(3)}\end{bmatrix}}\begin{bmatrix}u \\{U(12)} \\{U(13)} \\{U(22)} \\{U(23)}\end{bmatrix}} & (14)\end{matrix}$

Note again that the number of active rules (2²=4 for two inputs) dependonly on the number of inputs and not on the number of rules (9 in thiscase). Once the location of the first active rule is known, the locationof the rest of the rules can be obtained from the list of rules given inequation (14) using this location. The location of the first activerule, L(1), in the list of rules given in equation (14) can be obtainedusing the following equation

L(1)=(index₁ ¹+(index₂ ¹−1)×(no of membership functions in input2))  (15)

where index₁ ¹ is the value of the first active membership function ininput1 fuzzy set (2 for the above example) and index₂ ¹ is the value ofthe first active membership function in input2 fuzzy set (1 for theabove example). Therefore, L(1)=2+(1−1)*3=2. Since two adjacentmembership functions are active for each input, the location of thesecond active rule is always equal to L(2)=L₁+1 and the location of thefourth active rule is equal to L(4)=L₃+1. The location of the thirdactive rule is given by L(3)=L(1)+number of fuzzy sets in input1.Therefore, L(3)=2+3=5 for the above example. Note also index₁ ²=3 andindex₂ ²=2. Now, if u(2), u(3), u(5) and u(6) are the center points ofoutput fuzzy sets U(12), U(13), U(22) and U(23), respectively inequation (14), the four rule listed above can be represented as 2×2matrix in equation (16) as

$\begin{matrix}{A_{2} = {\begin{bmatrix}{u(2)} & {u(5)} \\{u(3)} & {u(6)}\end{bmatrix} = \begin{bmatrix}A_{1} & A_{1}^{\prime}\end{bmatrix}}} & (16)\end{matrix}$

where A1 is a 2×1 vector containing the center points of two adjacentactive rules of input1 for the first active membership function ofinput2 and t and

$\begin{matrix}{A_{1}^{\prime} = {\begin{bmatrix}{u(5)} \\{u(6)}\end{bmatrix} = \begin{bmatrix}{a(3)} \\{a(4)}\end{bmatrix}}} & (17)\end{matrix}$

is a 2×1 vector containing the center points of the two active rules ofinput1 for the second active membership function of input2. Usingequation (6), the output of fuzzy system with 2-inputs, 1—output isgiven by

$\begin{matrix}\begin{matrix}{{{out}(2)} = {{{\mu_{x\; 2}\left( {index}_{2}^{1} \right)}\left( {{{\mu_{x\; 1}\left( {index}_{1}^{1} \right)}{a(1)}} + {{\mu_{x\; 1}\left( {index}_{1}^{2} \right)}{a(2)}}} \right)} +}} \\{{{\mu_{x\; 2}\left( {index}_{2}^{2} \right)}\left( {{{\mu_{x\; 1}\left( {index}_{1}^{1} \right)}{a(3)}} + {{\mu_{x\; 1}\left( {index}_{1}^{2} \right)}{a(4)}}} \right)}} \\{= \left\lbrack {{\mu_{x\; 2}\left( {index}_{2}^{1} \right)}\mspace{14mu} {\mu_{x\; 2}\left( {index}_{2}^{2} \right)}} \right\rbrack} \\{\begin{bmatrix}{{{\mu_{x\; 1}\left( {index}_{1}^{1} \right)} \times {a(1)}} + {{\mu_{x\; 1}\left( {index}_{1}^{2} \right)} \times {a(2)}}} \\{{{\mu_{x\; 1}\left( {index}_{1}^{1} \right)} \times {a(3)}} + {{\mu_{x\; 1}\left( {index}_{1}^{2} \right)} \times {a(4)}}}\end{bmatrix}} \\{= {\left\lbrack {{\mu_{x\; 2}\left( {index}_{2}^{1} \right)}\mspace{14mu} {\mu_{x\; 2}\left( {index}_{2}^{2} \right)}} \right\rbrack \begin{bmatrix}{f(1)} \\{f(3)}\end{bmatrix}}} \\{= {g\left( {2,2} \right)}}\end{matrix} & (18)\end{matrix}$

where f(1) is the output of the 1—input system using the membershipvalues of two active membership functions of input1 μ_(x1) (index₁ ¹)and μ_(x1) (index₁ ²) and the center points of the first two adjacentactive output membership functions (2²/2) obtained from the list ofrules using equation (15) and f(3) is the output of the 1-input systemusing the membership values of input1 μ_(x1) (index₁ ¹) and μ_(x1)(index₁ ²), and the center points of the next two adjacent active outputmembership functions obtained from the list of rules. Note that f(1) andf(3) are found using equation (12). These two outputs are thenmultiplied with the membership values of two adjacent active membershipfunctions of input2 (μ_(x2) (index₂ ¹) and μ_(x2) (index₂ ²). Thisprocess may, in some embodiments, be implemented recursively andextended to a 3-input, 1-output system by selecting the active rulesfrom the list of rules.

For the 3-inputs 1-output (n=3) fuzzy system with 3 membership functionsin each input fuzzy set, there will be 27 linguistic rules. These rulesare described in natural language as:

If input3 is X₃(l) and input2 is X₂(k) and input1 is X₁(j) then outputis U(lkj) where 1≦l≦ (number of membership functions within the input3fuzzy set (X₃(l))). If each input variable has three membershipfunctions, there are 27 rules (R₁ . . . R₂₇). Note that the rules arelisted in the order of all combinations of first membership function ofinput3 and all combinations of input1 and input2 membership functionsfollowed by the rest of the membership functions of input3 and allcombinations of input1 and input2 membership functions. If threemembership functions in the output fuzzy sets are assumed, the rule listfor the 3-input fuzzy system (such as a PID controller) may be writtensimilar to equation (14). The location of the first active rule L(1) isgiven by:

L(1)=(index₁ ¹+(index₂ ¹−1)×(no of membership functions ininput2)+(index₃ ¹−1)×(no of membership functions in input3))   (19)

where index₃ ¹ is the index of the first active membership function forinput3. Locations of the 2^(nd), 3^(rd), and 4^(th) active ruleslocation (L(2) . . . L(4)) can be found as explained above in the2-input example. The locations of the 4 additional active rules may beobtained by adding:

(no of membership functions in input1)×(no of membership functions ininput2) to the previous four locations. Now, if input1 lies with thecenter points of membership functions Z(X₁(2)) and P(X₁(3)) (index₁¹=2); the normalized value of input2 lies within the center points ofmembership functions Z(X₂(2)) and P(X₂(3)) (index₂ ¹=2); and thenormalized value of input3 lies within the center points of membershipfunctions N(X₃(1)) and Z(X₃(2)) (index₃ ¹=1), there will always be 8active rules irrespective of the total number of rules. The location ofthe first active rules is calculated using equation (19) asL(1)=2+(1−1)*3+(1−1)*3=2. The locations of the second, third and fourthactive rules are obtained as explained for two-input fuzzy systemdiscussed above. Locations of the remaining four active rules may beobtained by adding (no of membership functions in input1)×(no ofmembership functions in input2) to the previous four locations.Therefore, L(5)=2+3*3=11, L(6)=12, L(7)=14, and L(8)=15. These eightrules can be represented as a 2×2 matrix for the first 2-inputs given inequation (16) and the center points of the additional 4 rules given in(20) as

$\begin{matrix}{A_{3} = {\begin{bmatrix}{u(11)} & {u(14)} \\{u(12)} & {u(15)}\end{bmatrix} = \begin{bmatrix}{a(5)} & {a(7)} \\{a(6)} & {a(8)}\end{bmatrix}}} & (20)\end{matrix}$

Using the weighted average method, the output of the 3-inputs 1-outputfuzzy system is given by

$\begin{matrix}\begin{matrix}{{{out}(3)} = {{\mu_{x\; 3}\left( {index}_{3}^{1} \right)}\left\lbrack \left\lbrack \begin{matrix}{\mu_{x\; 2}\left( {index}_{2}^{1} \right)} & {\left. {\mu_{x\; 2}\left( {index}_{2}^{2} \right)} \right\rbrack \times}\end{matrix} \right. \right.}} \\{\left. \begin{bmatrix}{{{\mu_{x\; 1}\left( {index}_{1}^{1} \right)}a_{1}} + {{\mu_{x\; 1}\left( {index}_{1}^{2} \right)}a_{2}}} \\{{{\mu_{x\; 1}\left( {index}_{1}^{1} \right)}a_{3}} + {{\mu_{x\; 1}\left( {index}_{1}^{2} \right)}a_{4}}}\end{bmatrix} \right\rbrack +} \\{{{\mu_{x\; 3}\left( {index}_{3}^{2} \right)}\left\lbrack \left\lbrack \begin{matrix}{\mu_{x\; 2}\left( {index}_{2}^{1} \right)} & {\left. {\mu_{x\; 2}\left( {index}_{2}^{2} \right)} \right\rbrack \times}\end{matrix} \right. \right.}} \\\left. \begin{bmatrix}{{{\mu_{x\; 1}\left( {index}_{1}^{1} \right)}a_{4}} + {{\mu_{x\; 1}\left( {index}_{1}^{2} \right)}a_{5}}} \\{{{\mu_{x\; 1}\left( {index}_{1}^{1} \right)}a_{6}} + {{\mu_{x\; 1}\left( {index}_{1}^{2} \right)}a_{7}}}\end{bmatrix} \right\rbrack \\{= {{\mu_{x\; 3}\left( {index}_{3}^{1} \right)}\left\lbrack {\left\lbrack {\begin{matrix}{\mu_{x\; 2}\left( {index}_{2}^{1} \right)} & {\left. {\mu_{x\; 2}\left( {index}_{2}^{2} \right)} \right\rbrack \times}\end{matrix}\begin{bmatrix}{f(1)} \\{f(3)}\end{bmatrix}} \right\rbrack +} \right.}} \\{{{\mu_{x\; 3}\left( {index}_{3}^{2} \right)}\left\lbrack \left\lbrack {\begin{matrix}{\mu_{x\; 2}\left( {index}_{2}^{1} \right)} & {\left. {\mu_{x\; 2}\left( {index}_{2}^{2} \right)} \right\rbrack \times}\end{matrix}\begin{bmatrix}{f(5)} \\{f(7)}\end{bmatrix}} \right\rbrack \right.}} \\{= \left\lbrack \begin{matrix}{\mu_{x\; 3}\left( {index}_{3}^{1} \right)} & {\left. {\mu_{x\; 3}\left( {index}_{3}^{2} \right)} \right\rbrack \times \begin{bmatrix}{g\left( {2,2} \right)} \\{g\left( {6,2} \right)}\end{bmatrix}}\end{matrix} \right.} \\{= {g\left( {6,3} \right)}}\end{matrix} & (21)\end{matrix}$

Note again that the first active rules are used to find f(1) and f(3)using equation (15), and the rest of the four active rules are used tocalculate f(5) and f(7). As in the 2-input system, one output g(2,2) isproduced by multiplying the membership values of two adjacent activemembership functions of input2 (μ_(x2)(index₁ ¹) and μ_(x2) (index₁ ²))with f(1) and f(3). The second output g(6,2) is calculated bymultiplying the membership values of two adjacent active membershipfunctions of input2 (μ_(x2)(index₁ ¹) and μ_(x2) (index₁ ²)) with f(5)and f(7). These outputs are then multiplied with the membership valuesof two adjacent active membership functions of input3 (μ_(x3)(index₁ ¹)and μ_(x3) (index₁ ²)) to produce the output of the 3-input fuzzysystem.

Extending this now to an n-input, 1-output fuzzy system, ifX_(n)(index_(n) ¹) and X_(n)(index_(n) ²) are the two active membershipfunctions for inputn, the output of the n-input fuzzy system is given as

$\begin{matrix}{{{out}(n)} = {{g\left( {m,n} \right)} = \left\lbrack {\begin{matrix}{\mu_{xn}\left( {index}_{n}^{1} \right)} & \left. {\mu_{xn}\left( {index}_{n}^{2} \right)} \right\rbrack\end{matrix} \times \begin{bmatrix}{g\left( {{m - 2^{n - 1}},{n - 1}} \right)} \\{g\left( {m,{n - 1}} \right)}\end{bmatrix}} \right.}} & (22)\end{matrix}$

where m=2^(n)−2. Note again that g(m−2^(n−1), n−1) is the output of thefuzzy system with the first 2^(n−2) active rules of n−1 inputs fuzzysystem and g(m, n−1) is the output of the fuzzy system with n−1 inputsand the other 2^(n−2) active rules. Therefore, equation (22) is arecursive relationship to find the output of n-input fuzzy system. Thisrecursive relationship is illustrated in the flow diagram in FIG. 4.

Turning now to FIG. 4, the recursive process begins at block 30.Membership functions associated with each of the n-inputs are defined inblock 32 and a list of fuzzy rules are defined in block 34. A firstinput of the n-input fuzzy system is selected in block 36. Two activerules and their corresponding outputs are selected based on the selectedinput in block 38. Then, membership values of the two active membershipfunctions for the selected input are determined in block 40. The twomembership values are multiplied with the outputs of the two activerules to product an output in block 42. If there is no previously savedoutput (“No” branch of decision block 44), then the output is saved inblock 46. If there is a previously saved output (“Yes” branch ofdecision block 44), then the newly calculated output is multiplied bythe saved output and this product is saved in block 48. After the outputhas been saved in either block 46 or 48 a check is made for anotherinput. If there is another input to the n-input fuzzy system (“Yes”branch of decision block 50), then the next input is selected at block52 and the process repeats blocks 38 through 48. If all inputs have beenprocessed (“No” branch of decision block 50), then the saved outputmaybe output for use in a control system or sent to a process beingcontrolled in block 54. The process ends at block 56.

The process in the flow diagram in FIG. 4 was implemented as a Matlabfunction as shown in FIG. 5, though the recursive algorithm may beimplemented in any programming language on any system, includinghardware implementations embedded in FLCs. The inputs to the recursivefunction are the number of inputs (n) applied to the fuzzy system, theactual inputs (input), the center points of the membership functions inthe n input fuzzy sets (centers), the number of membership functions ineach fuzzy set (mf), and the rule list (R) containing the center pointsof the output fuzzy sets for the total number of rules.

The methodology presented above and used in embodiments of the inventionwas used to implement fuzzy systems with 2 to 10 inputs having 5membership functions each. Table 1 contains the computation timesrequired to implement these fuzzy systems with the recursive methodologyutilized in the embodiments of the invention and a contemporary methodon a 2.7 GHz CPU with 16 GB RAM. Graph 60 in FIG. 6 shows the log of thecomputation time in seconds verses the number of inputs. It can be seenfrom Table 1 that the computation time increases linearly with thenumber of inputs on curve 62 related to the recursive method, whereasthis time increases exponentially on curve 64 related to thecontemporary method. For example, it takes 414 seconds to implement 10inputs fuzzy system with the contemporary method due to dimensionality;however, it takes only 0.42 milliseconds to implement the same systemwith the recursive method. This time saving is beneficial inimplementing multi-layered fuzzy tree in complex systems.

TABLE 1 Computation Times for 2 to 10 Input Fuzzy Systems Number ofInputs 2 3 4 5 6 7 8 9 10 Contemporary 2.65E−4 1.77E−3 1.15E−2 6.67E−24.13E−1 2.28 14.1 80.2 414 Method Recursive 1.75E−6  3.6E−6  7.3E−61.41E−5  2.8E−5 5.4E−5 1.1E−4 2.0E−5 4.2E−4 Method

The recursive method implemented in embodiments of the invention wasalso used to implement a 4-input fuzzy system with 3 to 9 membershipfunctions in each input. Table 2 contains the computation times requiredto implement these fuzzy systems with the recursive and the contemporarymethods. Graph 70 in FIG. 7 shows the log of the computation time inseconds versus the number of membership functions. It can be seen fromthe curves 72, 74 that the computation time for the contemporary method(curve 72) also increases rapidly whereas the times remain constant withthe recursive method (curve 74).

TABLE 2 Computation Times for 4 Input Fuzzy Systems Number of MembershipFunctions 3 5 7 9 Contemporary Method 2.48E−4 1.15E−2 4.42E−2 1.12E−1Recursive Method 3.65E−6  3.7E−6 3.74E−6 3.75E−6

For further performance gains, the fuzzy logic system may be reduced toa piecewise linear representation. Embodiments of the inventionutilizing the recursive methods may be used to generate affine gains fordifferent modes. For example, a 2-input, 1-output fuzzy system may berepresented as:

out(2)=K ₁ x ₁ +K ₂ x ₂ +K ₁₂ x ₁ ×x ₂+Const   (23)

K₁ is the gain for input x₁. K₂ is the gain for input x₂. K₁₂ is thenonlinear term gain and Const is a constant term. All of the gains andthe constant may be determined using embodiments of the invention.Setting the first term x₁ to its normalized extremes of [−1, 1] in theequation will result in the gain value for K₁.

$\begin{matrix}{K_{1} = {{\frac{1}{D}\left\lbrack {{{x_{2}\left( {k + 1} \right)}\left( {{u(2)} - {u(1)}} \right)} - {{x_{2}(k)}\left( {{u(4)} - {u(3)}} \right)}} \right\rbrack} = {\frac{1}{D}\left\lbrack \begin{matrix}{x_{2}\left( {k + 1} \right)} & {\left. {- {x_{2}(k)}} \right\rbrack {A_{1}\begin{bmatrix}{- 1} \\1\end{bmatrix}}}\end{matrix} \right.}}} & (24)\end{matrix}$

Similarly, setting the second term x₂ to its normalized extremes of [−1,1] will result in the gain value for K₂.

$\begin{matrix}{K_{2} = {{\frac{1}{D}\left\lbrack {{{x_{1}\left( {j + 1} \right)}\left( {{u(2)} - {u(1)}} \right)} - {{x_{1}(j)}\left( {{u(4)} - {u(3)}} \right)}} \right\rbrack} = {\frac{1}{D}\left\lbrack {\begin{matrix}{- 1} & {\left. 1 \right\rbrack A_{1}}\end{matrix}\begin{bmatrix}{x_{1}\left( {j + 1} \right)} \\{- {x_{1}(j)}}\end{bmatrix}} \right.}}} & (25)\end{matrix}$

Setting both x₁ and x₂ to [−1, 1] will results in the gain value forK₁₂.

$\begin{matrix}{K_{12} = {{\frac{1}{D}\left\lbrack {\left( {{u(1)} - {u(2)}} \right) - \left( {{u(3)} - {u(4)}} \right)} \right\rbrack} = {\frac{1}{D}\left\lbrack {\begin{matrix}{- 1} & {\left. 1 \right\rbrack A_{1}}\end{matrix}\begin{bmatrix}{- 1} \\1\end{bmatrix}} \right.}}} & (26)\end{matrix}$

Finally, setting x₁ and x₂ to their center values will result in Constconstant value.

$\begin{matrix}{{Const} = {{\frac{1}{D}\left\lbrack {{{x_{2}\left( {k + 1} \right)}\left( {{{x_{1}\left( {j + 1} \right)}{u(2)}} - {{x_{1}(j)}{u(1)}}} \right)} - {{x_{2}(k)}\left( {{{x_{1}\left( {j + 1} \right)}{u(3)}} - {{x_{1}(j)}{u(4)}}} \right)}} \right\rbrack} = {\frac{1}{D}\left\lbrack {\begin{matrix}{x_{2}\left( {k + 1} \right)} & {\left. {- {x_{2}(k)}} \right\rbrack A_{1}}\end{matrix}\begin{bmatrix}{x_{1}\left( {j + 1} \right)} \\{- {x_{1}(j)}}\end{bmatrix}} \right.}}} & (27)\end{matrix}$

D=(x₁(j+1)−x₁(j))×(x₂(k+1)−x₂(k)) for equations 24-27 above. These gainsand constant value may now be inserted into equation (23) and utilizedby a control system to obtain an output from the two inputs. Thispiecewise representation of the fuzzy system may be realized in anynumber of hardware configurations within the control system, such as inan ASIC or FPGA.

This same process may be extended to any n-input, 1-output system, withthe embodiments of the invention being utilized to calculate thecoefficients (gains) and constant as set out above. As a furtherexample, a piecewise representation for a 3-input system is:

out (3)=K ₁ x ₁ +K ₂ x ₂ +K ₃ x ₃ +K ₁₂ x ₁ ×x ₂ +K ₁₃ x ₁×x₃ +K ₂₃ x ₂×x ₃ +K ₁₂₃ x ₁ ×x ₂ ×x ₃+Const   (28)

Similar to the 2 input system, K₁, K₂, and K₃ are gains for inputs x₁,x₂, and x₃ respectively. K₁₂, K₁₃, K₂₃, and K₁₂₃ are the gains for thenonlinear terms. And, Const is the constant term. For each of theequations below, D=(x₁(j+1)−x₁(j))×(x₂(k+1)×x₂(k))×(x₃(l+1)−x₃(l)).

$\begin{matrix}{\mspace{79mu} {K_{1} = {\frac{1}{D}\left\lbrack {\begin{matrix}{x_{3}\left( {l + 1} \right)} & \left. {- {x_{3}(l)}} \right\rbrack\end{matrix}\begin{bmatrix}\left\lbrack \begin{matrix}{x_{2}\left( {k + 1} \right)} & \left. {- {x_{2}(k)}} \right\rbrack\end{matrix} \right. & {A_{1}\begin{bmatrix}{- 1} \\1\end{bmatrix}} \\\left\lbrack \begin{matrix}{x_{2}\left( {k + 1} \right)} & \left. {- {x_{2}(k)}} \right\rbrack\end{matrix} \right. & {A_{2}\begin{bmatrix}{- 1} \\1\end{bmatrix}}\end{bmatrix}} \right.}}} & (29) \\{\mspace{79mu} {K_{2} = {\frac{1}{D}\left\lbrack \begin{matrix}{x_{3}\left( {l + 1} \right)} & {\left. {- {x_{3}(l)}} \right\rbrack \begin{bmatrix}\left\lbrack \begin{matrix}{- 1} & \left. 1 \right\rbrack\end{matrix} \right. & {A_{1}\begin{bmatrix}{x_{1}\left( {j + 1} \right)} \\{- {x_{1}(j)}}\end{bmatrix}} \\\left\lbrack \begin{matrix}{- 1} & \left. 1 \right\rbrack\end{matrix} \right. & {A_{2}\begin{bmatrix}{x_{1}\left( {j + 1} \right)} \\{- {x_{1}(j)}}\end{bmatrix}}\end{bmatrix}}\end{matrix} \right.}}} & (30) \\{\mspace{79mu} {K_{3} = {\frac{1}{D}\left\lbrack {\begin{matrix}{- 1} & \left. 1 \right\rbrack\end{matrix}\begin{bmatrix}\left\lbrack \begin{matrix}{x_{2}\left( {k + 1} \right)} & \left. {- {x_{2}(k)}} \right\rbrack\end{matrix} \right. & {A_{1}\begin{bmatrix}{x_{1}\left( {j + 1} \right)} \\{- {x_{1}(j)}}\end{bmatrix}} \\\left\lbrack \begin{matrix}{x_{2}\left( {k + 1} \right)} & \left. {- {x_{2}(k)}} \right\rbrack\end{matrix} \right. & {A_{2}\begin{bmatrix}{x_{1}\left( {j + 1} \right)} \\{- {x_{1}(j)}}\end{bmatrix}}\end{bmatrix}} \right.}}} & (31) \\{\mspace{79mu} {K_{12} = {\frac{1}{D}\left\lbrack {\begin{matrix}{x_{3}\left( {l + 1} \right)} & \left. {- {x_{3}(l)}} \right\rbrack\end{matrix}\begin{bmatrix}\left\lbrack \begin{matrix}{- 1} & \left. 1 \right\rbrack\end{matrix} \right. & {A_{1}\begin{bmatrix}{- 1} \\1\end{bmatrix}} \\\left\lbrack \begin{matrix}{- 1} & \left. 1 \right\rbrack\end{matrix} \right. & {A_{2}\begin{bmatrix}{- 1} \\1\end{bmatrix}}\end{bmatrix}} \right.}}} & (32) \\{\mspace{79mu} {K_{13} = {\frac{1}{D}\left\lbrack {\begin{matrix}{- 1} & \left. 1 \right\rbrack\end{matrix}\begin{bmatrix}\left\lbrack \begin{matrix}{x_{2}\left( {k + 1} \right)} & \left. {- {x_{2}(k)}} \right\rbrack\end{matrix} \right. & {A_{1}\begin{bmatrix}{- 1} \\1\end{bmatrix}} \\\left\lbrack \begin{matrix}{x_{2}\left( {k + 1} \right)} & \left. {- {x_{2}(k)}} \right\rbrack\end{matrix} \right. & {A_{2}\begin{bmatrix}{- 1} \\1\end{bmatrix}}\end{bmatrix}} \right.}}} & (33) \\{\mspace{79mu} {K_{23} = {\frac{1}{D}\left\lbrack {\begin{matrix}{- 1} & \left. 1 \right\rbrack\end{matrix}\begin{bmatrix}\left\lbrack \begin{matrix}{- 1} & \left. 1 \right\rbrack\end{matrix} \right. & {A_{1}\begin{bmatrix}{x_{1}\left( {j + 1} \right)} \\{- {x_{1}(j)}}\end{bmatrix}} \\\left\lbrack \begin{matrix}{- 1} & \left. 1 \right\rbrack\end{matrix} \right. & {A_{2}\begin{bmatrix}{x_{1}\left( {j + 1} \right)} \\{- {x_{1}(j)}}\end{bmatrix}}\end{bmatrix}} \right.}}} & (34) \\{\mspace{79mu} {K_{123} = {\frac{1}{D}\left\lbrack {\begin{matrix}{- 1} & \left. 1 \right\rbrack\end{matrix}\begin{bmatrix}\left\lbrack \begin{matrix}{- 1} & \left. 1 \right\rbrack\end{matrix} \right. & {A_{1}\begin{bmatrix}{- 1} \\1\end{bmatrix}} \\\left\lbrack \begin{matrix}{- 1} & \left. 1 \right\rbrack\end{matrix} \right. & {A_{2}\begin{bmatrix}{- 1} \\1\end{bmatrix}}\end{bmatrix}} \right.}}} & (35) \\{{Const} = {\frac{1}{D}\left\lbrack {\begin{matrix}{x_{3}\left( {l + 1} \right)} & \left. {- {x_{3}(l)}} \right\rbrack\end{matrix}\begin{bmatrix}\left\lbrack \begin{matrix}{x_{2}\left( {k + 1} \right)} & \left. {- {x_{2}(k)}} \right\rbrack\end{matrix} \right. & {A_{1}\begin{bmatrix}{x_{1}\left( {j + 1} \right)} \\{- {x_{1}(j)}}\end{bmatrix}} \\\left\lbrack \begin{matrix}{x_{2}\left( {k + 1} \right)} & \left. {- {x_{2}(k)}} \right\rbrack\end{matrix} \right. & {A_{2}\begin{bmatrix}{x_{1}\left( {j + 1} \right)} \\{- {x_{1}(j)}}\end{bmatrix}}\end{bmatrix}} \right.}} & (36)\end{matrix}$

As set forth above, embodiments of the invention may be implemented in anumber of different hardware configurations. FIG. 8 is a diagrammaticillustration of an exemplary hardware and software environment for acontroller 80 capable of implementing a fuzzy logic system consistentwith embodiments of the invention. Controller 80, in specificembodiments, may be a general purpose processor, application specificintegrated circuit (ASIC), field programmable gate array (FPGA),computer, computer system, computing device, server, disk array, orprogrammable device such as a multi-user computer, a single-usercomputer, a handheld computing device, a networked device (including acomputer in a cluster configuration), a mobile telecommunicationsdevice, etc.

The controller 80 includes at least one central processing unit (“CPU”)82 coupled to a memory 84. Each CPU 12 is typically implemented inhardware using circuit logic disposed on one or more physical integratedcircuit devices or chips. Each CPU 82 may be one or moremicroprocessors, micro-controllers, field programmable gate arrays, orASICs, while memory 84 may include random access memory (RAM), dynamicrandom access memory (DRAM), static random access memory (SRAM), flashmemory, and/or another digital storage medium, and also typicallyimplemented using circuit logic disposed on one or more physicalintegrated circuit devices, or chips. As such, memory 84 may beconsidered to include memory storage physically located elsewhere in thecontroller 80, e.g., any cache memory in the at least one CPU 82, aswell as any storage capacity used as a virtual memory, e.g., as storedon a storage device 86.

The controller 80 may have at least one input 88 coupled to thecontroller 80 through an input/output device interface 90 (illustratedas, and hereinafter, “I/O I/F” 90). This at least one input 88 mayprovide controller 80 with data or other commands to access internalfunctionality of controller 80. Controller 80 may also receive data orother commands from another computing system 92 coupled to controller 80through at least one network interface 94 (illustrated as, andhereinafter, “network I/F” 94) by way of at least one network 96.Controller 80 may also provide output to at least one controller output98 for communication with a user or provided to a process beingcontrolled.

The controller 80 is typically under the control of an operating system100 and executes or otherwise relies upon various software applications,sequences of operations, components, programs, files, objects, modules,etc., consistent with embodiments of the invention. In specificembodiments, the controller 80 may execute or otherwise rely upon afuzzy logic system 102 consistent with embodiments of the inventionmanage input data, as well as generate controller outputs. Moreover, andin specific embodiments, the controller 80 may be configured with adatabase 104 to store data related to fuzzy rules and membershipfunctions consistent with embodiments of the invention.

While the present invention has been illustrated by a description of oneor more embodiments thereof and while these embodiments have beendescribed in considerable detail, they are not intended to restrict orin any way limit the scope of the appended claims to such detail.Additional advantages and modifications will readily appear to thoseskilled in the art. The invention in its broader aspects is thereforenot limited to the specific details, representative apparatus andmethod, and illustrative examples shown and described. Accordingly,departures may be made from such details without departing from thescope of the general inventive concept.

What is claimed is:
 1. A method of determining an output of an n-inputfuzzy logic system, the method comprising: determining a plurality ofmembership functions associated with a corresponding plurality of inputsto the n-input fuzzy logic system; defining a list of fuzzy rules forthe n-input fuzzy logic system; selecting an input of the plurality ofinputs; selecting two active rules and their corresponding output valuesfrom the list of rules based on the selected input; determiningmembership values of two active membership functions based on theselected input; calculating an output of the n-input fuzzy system bymultiplying the two membership values with the output of the two activerules; saving the calculated output; in response to additional inputs ofthe plurality of inputs, recursively repeating for each additional inputof the plurality of inputs: selecting of an additional input of theplurality of inputs; determining two active rules and correspondingoutput values from the list of rules based on the selected additionalinput; determining membership values of two active membership functionsbased on the selected additional input; calculating an intermediateoutput of the n-input fuzzy system by multiplying the two membershipvalues with the output of the two active rules based on the selectedadditional input; multiplying the saved calculated output and thecalculated intermediate output; and saving the multiplied calculatedoutput; and in response to no additional inputs of the plurality ofinputs, outputting the saved calculated output.
 2. The method of claim1, wherein the active membership functions are triangular membershipfunctions.
 3. The method of claim 2, wherein the active membershipfunctions are adjacent and overlap.
 4. The method of claim 3, whereinthe active membership functions terminate at a center-point of adjacentmembership functions.
 5. The method of claim 3, wherein a sum ofmembership values for the active membership functions is
 1. 6. Themethod of claim 1, wherein the plurality of inputs are normalized. 7.The method of claim 6, wherein the plurality of inputs are normalized toa value of
 1. 8. A method of reducing a fuzzy logic system to apiecewise linear representation, the method comprising: determining aplurality of gains associated with each of a plurality of inputs of ann-input fuzzy system by: setting an input of the plurality of inputs tonormalized extreme values; determining an output of a fuzzy system usingthe method of claim 1 with the set inputs; and setting a gain of theplurality of gains corresponding to the input of the plurality of inputsto the determined output; and repeating for each input of the pluralityof inputs; determining a plurality of nonlinear gains associated withcombinations of the inputs of the plurality of inputs by: setting eachinput of the plurality of inputs in a combination of the inputs to thenormalized extreme values; determining an output of a fuzzy system usingthe method of claim 1 with the set inputs; setting a gain of theplurality of gains corresponding to the combination of inputs to thedetermined output; and repeating for each combination of inputs of theplurality of inputs; and determining a constant of the piecewise linearrepresentation of the fuzzy logic system by: setting each input of theplurality of input to its corresponding center value; determining anoutput of a fuzzy system using the method of claim 1 with the setinputs; setting the constant to the determined output.
 9. The method ofclaim 8, wherein the normalized extreme values are −1 and
 1. 10. Acontroller, comprising a memory; a processor; program code, resident inthe memory and configured to determine a controller output when executedby the processor; the program code further configured to determine aplurality of membership functions associated with a correspondingplurality of inputs to the n-input fuzzy logic system, define a list offuzzy rules for the n-input fuzzy logic system, select an input of theplurality of inputs, select two active rules and their correspondingoutput values from the list of rules based on the selected input,determining membership values of two active membership functions basedon the selected input, calculate an output of the n-input fuzzy systemby multiplying the two membership values with the output of the twoactive rules, and save the calculated output; the program code furtherconfigured, in response to additional inputs of the plurality of inputs,to recursively repeat for each additional input of the plurality ofinputs: selecting of an additional input of the plurality of inputs;determining two active rules and corresponding output values from thelist of rules based on the selected additional input; determiningmembership values of two active membership functions based on theselected additional input; calculating an intermediate output of then-input fuzzy system by multiplying the two membership values with theoutput of the two active rules based on the selected additional input;multiplying the saved calculated output and the calculated intermediateoutput; and saving the multiplied calculated output; and the programcode further configured, in response to no additional inputs of theplurality of inputs, to output the saved calculated output.
 11. Thecontroller of claim 10, wherein the active membership functions aretriangular membership functions.
 12. The controller of claim 11, whereinthe active membership functions are adjacent and overlap.
 13. Thecontroller of claim 12, wherein the active membership functionsterminate at a center-point of adjacent membership functions.
 14. Thecontroller of claim 12, wherein a sum of membership values for theactive membership functions is
 1. 15. The controller of claim 10,wherein the plurality of inputs are normalized.
 16. The controller ofclaim 15, wherein the plurality of inputs are normalized to a value of1.